//
//  MLNavController.swift
//  MLWeiBo
//
//  Created by wenxing on 2017/1/4.
//  Copyright © 2017年 Se7venX. All rights reserved.
//

import UIKit

class MLNavController: UINavigationController {


    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        
        
        if self.viewControllers.count>0 {
            
            viewController.hidesBottomBarWhenPushed = true
            
            viewController.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "返回", imageName: "navigationbar_back_withtext", tatget: self, selector: #selector(back))
        }
        
        
        
       super.pushViewController(viewController, animated: animated)
    }
    
    
    @objc private func back() {
    
       _ =  self.popViewController(animated: true)
    
    
    }

}
